/**
 * @author honway.liu
 * @date 2019-02-24 14:55
 * @email gm100861@gmail.com
 * @blog http://linuxsogood.org
 */
public class RunnerTask implements Runnable {

    private static int count;

    public RunnerTask() {
        count = 0;
    }

    @Override
    public void run() {
        synchronized (this) {
            for (int i = 0; i < 5; i++) {
                System.out.println(Thread.currentThread().getName() + ":" + count++);
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }

    public static int getCount() {
        return count;
    }
}
